package com.yunyao.framework.service;

import com.yunyao.common.dto.excel.ContractExcelDto;
import com.yunyao.common.dto.excel.ProjectOrderExcelDto;
import com.yunyao.common.dto.order.ProjectOrderDto;
import com.yunyao.common.dto.order.SupplyOrderDto;
import com.yunyao.common.dto.project.OrderAuditAttachmentDto;
import com.yunyao.common.web.util.PageResult;
import com.yunyao.common.web.util.YResult;
import com.yunyao.framework.dto.audit.ApprovalDto;
import com.yunyao.framework.dto.audit.SubmitApprovalDto;
import com.yunyao.framework.dto.projectorder.ProjectOrderSaveDto;
import com.yunyao.framework.dto.sale.SaleContractApprovalDto;
import com.yunyao.framework.dto.sale.SaleContractSubmitApprovalDto;
import com.yunyao.framework.vo.projectorder.CheckSupplyVO;
import com.yunyao.framework.vo.projectorder.OrderAuditAttachmentVO;
import com.yunyao.framework.vo.projectorder.OrderSnAndNameVO;
import com.yunyao.framework.vo.projectorder.ProjectOrderVO;

import java.util.List;

/**
 * 项目订单
 * @author chenyejian
 * @date 2024-07-16
 */
public interface ProjectOrderService {
    /**
     * 根据条件分页查询项目列表
     * @param   projectOrderDto
     * @return
     */
    YResult<PageResult<ProjectOrderVO>> pageList(ProjectOrderDto projectOrderDto);

    YResult<ProjectOrderVO> getOrderDetailById(String id);

    YResult<String> saveOrUpdate(ProjectOrderSaveDto projectOrderSaveDto);

    YResult<String> deleteByIds(String[] ids);


    YResult<String> supplyFinish(String id);

    /**
     * 提交审批
     *
     * @param approvalDto
     * @return
     */
    YResult<String> submitApproval(SubmitApprovalDto approvalDto);

    /**
     * 审批
     * @param approvalDto
     * @return
     */
    YResult<String> approval(ApprovalDto approvalDto);

    /**
     * 审批撤销
     * @param approvalDto
     * @return
     */
    YResult<String> revocation(ApprovalDto approvalDto);


    YResult<String> audit(ProjectOrderDto orderDto);


    /**
     * 自动生成项目订单号-订单名称
     * @param contractId
     * @return
     */
    YResult<OrderSnAndNameVO> getSnAndNameByContractId(String contractId);



    YResult<OrderAuditAttachmentVO> getAttachmentInfo(String orderId);

    YResult<String> saveAuditCloudAttachment(OrderAuditAttachmentDto attachmentDto);


    /**
     * 判断是否超出合同总价和材料数量
     * @param projectOrderSaveDto
     * @return
     */
    YResult<String> checkTotalPriceAndMaterialSum(ProjectOrderSaveDto projectOrderSaveDto);


    YResult<CheckSupplyVO> checkSupplyStatus(ProjectOrderDto orderDto);


    List<ProjectOrderExcelDto> export(ProjectOrderDto projectOrderDto);
}
